package com.magnificent.atlantis.client.connection;

import com.magnificent.atlantis.common.Connector;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * User: Babanin
 * Date: 08.04.2009
 * Time: 15:08:00
 */
public class ClientRMIConnector {
    public static Connector connect(String server, int port) {
        try {
            Registry registry = LocateRegistry.getRegistry(server, port);
            return (Connector) registry.lookup(Connector.NAME);
        } catch (Exception e) {
            return null;
        }
    }
}
